Code is working now. Final changes to exercise 3