add todo, move model() call out of loop