Changes to problem4 solution (remove @digit, move max_fact in a variable)