improving program flow