eliminated NANs by memsetting balCmd. Changed leg lengths