updated todo; cleaned up code more