Added getopt option parsing