some logic changes.