edited functions to fit better with the coding conventions.