added user-defined functions