Fixed bug that prevented finding a factor of 3