taking care of the functions