finished Lab5 code assignment option 1