removed the adajacent logic