refine magic constant for 2nd solution to problem 2