Updated tests, relative pahts, and moved code in functions