changed overall program flow