Merged in working version from hpc