Reorganized solution 3 and cleaned up code.