Optimized some code, taking out brackets for 1 line loops