Added more documentation cleaned up functions.