updated program flow