Mechanical design of a distal arm exoskeleton for stroke and spinal cord injury rehabilitation