tweaked for loops a bit