implemented iterative bruteforce
define C++ flags instead of C flags
added lots of comments
do not hard exit() the prog; minor improvements