Add isAhead function back