Added specifying subjects to gate function.
Updated discreteMatrix to use gate function.