Added a debug flag
Cleaned up the main binary a little