small changes related to the function