Fixed hue sat and value values. Formatted.
Optimized a bit and added debug statements and some new variables.
Merge origin/master