implemented a few utility functions