add check for getopt.h, add full debug messages, revert comments