adding ensure index support
more fixes
damn
beginning unit tests