Changed some for loops after talking to AV Nick