couple pieces of advice:
- use nullptr instead of NULL when it's a pointer
- report errors with a throw statement such as 'throw logic_error("balls");' or 'throw runtime_error("crap");'