write solution and test