moving functions to .php files so that can be called by other scripts