Introduction of useful functions

Introduction of useful functions