Finally got general constraints working.  Working on count function.