Added buttons on bottom, refactored some code.