User defined functions step 1