use alphabet index mapping instead of map lookup