updated example code and function names