added braces to while for code clarity
added resources on getopts