Cleaned up crazy for loop