optimize the way to find 5 adjacencies