added crystal tracking code