Added code file.  Some patterns still have red and green reversed.