added some misc helper function to rand module