Improving error handling

Just thought I would add commander to manage the command line and to improve the error handling a bit