This is redundant. A better working version now in subroutine getLegs