replaced optparse with argparse
added logging
added logging