Use foreach where possible
Small random changes