Fixed some bugs, and I added functionality to the buttons