Handle multiple objects and initialize grid with correct labels for objects