Added an image output to look for patterns. This now requires PIL.
Improved visualization