Made code review. a little pep8

Look if there some usable changes. 
ugly "for each" is not readable try to do it more simple