passed level 6 a very unclean code. need to refactor