working code with todos as a object