temp functions, needs to be refined down to fewer functions possibly,
some of the intermediate steps may never need to be used in other contexts