Messing around with Loop Optimizations

Some functions now use a different looping method that could speed
things up a bit. I'm not sure yet though, so it's just messing about for
now.