add comments from Matt-Esch gist
BUGFIX: correctly use `input`