first methods for calculating neighbours and errors