made corrections and improvements after reviewing code