adding function
updating code