Added some useful functions