functions to external file

allows for better functional portability later