add somewhat hacky py3 support