replaced sys with optparse, final part of the assignment complete