Solution 1
+more test and fixes