Added commentsto functions and file head