added the working code for todo