cleanup and added function descriptions
cleanup and added some documentation
cleanup and descriptions updated