Refactoring: Move data flushing into separate function.
Style update.
Added header for utility functions.
New coloring scheme.
Multiplying by 1 doesn't do much.