full working model flow