minor #cleanup: func now deals with errors
Merge pull request #2 from joeybaker/patch-1

Woot! thanks!