corrected indentation, fixed deprecation warnings