changed interated loops to use new classes