added some nifty functions