added built in error code support
changed LOCATION
added ARGS
refactored somewhat