Merged in changes. Finally works!
Add color coding to read/write.
Final tweaking and re-factoring.