modification to add function
Answers to TODOs