updated this exercise to simplify it a little