added check about having at least either successor or predecessor