1. More code clean up, removin debugging comments

2. Further documentation.

3. Renaming of functions in planner.