Implemented getopt code to retrieve prog args