Added code for functions