Update: codewars solution 1