Fix todoAdd bug and added some comments