Functional code before neighbour list