Improved performance by creating a list of neighbours