made a utility function