Replaced some code with functions.
Added help option and default case.
Added TODO.