broke apart some functions, made maximized