added further notes to function