work on sorted indexes, added opts to everything, added save and delete context