Cleaned up Problem 21
Cleaned up Problem 24