replaced optparse with argparse as optparse has been deprecated as of python version 2.7