added 3d support