Adds Function

This part adds the function however I get an error.