Commented functions

Added descriptive comments