suggested changes to unindex method; python3 compliance and bug fixes for indexing script