added some random helper functions.