Added python3 compatibility