Minor cleanup and comments

Added comments, explanations, TODOs, and removed bad things.