old school array loop instead of foreach because of weirdness