removal of variable in exception catch
removal of unused reference
rename of input
extra commenting and code improvement
improved code structure