default function change, error can be non default

changed default function value
added descriptive commenting as per request
User can now specify a non default error function