adding user-defined functions