create separate functions file to source from main