Added comments

Added comments at the top describing what the functions do.