added buttons to ui, also cleaned up code a little