First solution done better.