Rewrote this exercise.