working on generating funcs