flow diagram of the model