Cleaned up problem 1