Updated to solve all of the problems and the extra credit!