Rewrote several functions.
added support for background colors.