udpated with more utility functions