added user defined functions