final working version meeting requrements for checkpoint 3b