HW4: Related Function Completed.