Define myerror before using it

The myerror function is already called before it is defined.
Move the function above the first call.
Merge pull request #8 from ckorn/patch-1

Define myerror before using it