finished functions, gotta test and clean up