nitpick: can lines 18-34 be indented at the same depth.
If they look ok in your code check for tabs