added halfsolution for problem 169