Changed isNextToBlock method, now dependent on direction.