os.path didn't work for py3k, replacing it with itertools