Fixed having stuff inside a function when it didn't belong in it.