incomplete port from 2013.4 to 2014.1 with hkp3d