fixed indexex & unhashable issues; added tests