first version of solution + tests