removed unnecessary index(var) calls in set() and print()