update functions with Kevins comments