added some useful functions