added optional workspace to GEHD2
added optional workspace parameter and reorginized workspace internally