This commit uses global pre allocated work space to dramatically reduce memory usage and allocation time
note this implementation lacks many tests