phase 4: renamed most functions to match standard