hooked up the buttons to the proper controller action, refactored some javascript