improve lvl 3 solution