Completed template functions

Completed the two function as specified in the instructions