Added some useful functions.