Neighbours position calculations extracted