Improving factorial and sum of square examples