should be < here, not <=