added indexing and renaming to hash. improved cli.