One loop

made the two loops which iterate over data and data1 to one, data1 now
is in data