Efficient m-ary Balanced Codes