added functions and function calling