working solution in place + specs passing