Made while loop more concise.