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