Rewritten index more explicitly to avoid 6to5 hoisting-related bugs.