created some utility functions