added definition of both the functions