ahead_behind function

Ahead Behind