updates allmoves function to return the properly nested set of lists.