Can't tell from the code here if there's an indent. Good to add a comment to make it obvious (e.g. # Indent, then at the end, # End indent) It's really easy to forget the end of a block of code otherwise.