Added dynamically allocated neighbor grid