A damped least-squares solution to redundancy resolution