blank line missing here (and in a few more places - 2 blank lines between top-level function defs)