changed the utility function