add solution plus a simple test for verification