Modification to improve peak memory efficiency.

Also updated the todo list.