Converted GBn and GBn2 to use discrete functions (improves performance)