Added the more highly optimized function to synthesis.js.