Fixed and removed a redundancy in my code for problem 4.