Tracking is now performed using float[,] grid, which simplifies the code.