Small modification to utility function