fix indentation and python3 compability