more readable function equivalent