fix index, update tests, add options