Solved, except for extra credit