This loop never exits, I'm pretty sure it has something to do with this line.