Removed unused code.
Added todo's.
Fixed some bugs.