Made loop more concise and like rest of code