3d CUPL code