Converted section of code used both in main simulation and cluster counting to determine which neighbouring locations to check next given the existence of periodic boundaries into a function. Stored in tools.cpp, a file containing such boilerplate code. Condensed both as a result.