adding some useful functions