Added a couple of useful functions