added commenting to some of the functions
added commenting to some of the functions