Added comments to the code, modularized some functions and properly disabled the next step button during animations