Missing some blank lines in this code, especially here at the end of a function definition.