fixed debug print
use getopt() for options parsing