my sol, without .map, and book solution