Added buttons, started cleaning up code and documenting.