improved problem.c