updated for current three.js version