7/18/14 - implemented Gray rule but with bugs