Updated code

Cleaned up code into arrays, for loops