Added optparse to the code.