Reursive routines now working correctly