use enumerate instead of map