Adding some useful functions