Replaced indexing with zipWith for efficiency