From here to line 77 the indentation is off; all these lines look like they need 6 more spaces for correct nesting alignment