Added the getopts feature and the work around for my program structure.

Will need to make some more changes etc tomorrow