renamed function to make the code more readable