Some useful functions added