improve index (props to John Dalbey)