slight changes to logic.