ahead being calculated wrong