how do you factor trial and error