dividing into the good and the bad PROPERLY - CORRECTS FORMER OFF BY ONE ERROR