Uses return value of recursive function to store top level moves