added some indexing helper functions
fixing more tests