Added debug constants to turn on/off debug printing. Removed unused max_value parameter. Moved all GA and WoC parameters to end of script.