added functionality of defining functions