added function for step 3.