added tolerance option for neighbour criterion