main program flow schema done