added changes sugested during code review