Updated function AIsBetweenBAndC()