updating functions with comments