finished code solution in <55 lines