There should not be an empty line here. Also, I believe that the comment that you put above the function definition should be put right after it. (Python style conventions).