added loops and arrays