refactors home
refactors rest of functions in main closes #24