changed some silly lamdas to simple itterator