cleaned up for loop