Storing the movements in a stack.