I was actually thinking about rewriting that whole function, but I have yet to come up with something really nice.