really liked my implementation for this exercise