added comments describing function behavior