Added boolean to for loop. Five-fold performance increase.