Replace direction index with enum (slower!)