updated function completed 3