Added a fix for trippiness. Color generation leaves a lot to be desired, though.