Reorganized code. Will add comments. Fixed error with color commands.