Modify construction of glob to incorporate a proper index