Changed buttons to link and cleaned up some code