figuring index out