new changes in functions and calculating value