moved funcs out of main into their own cozy lil' source file