add leg position computation