I am making a simple chess game in Vanilla JS, and am trying to implement an undo move function where when you press a button, you can take back your move before passing it