better follow algorithm with backwards and with distance buffer