improved efficiency of isNextStar