Code cleanup. Adding comments. Adding TODO notes.