added partial translation from FastCube1