Comments added

Added comments describing function behavior