added early test for factors; more careful testing needed