added 3D; flawed, but working