Saved a few bytes by writing for loops differently.