changed getClosestState to the original

Chris: I left your code in there, but it seemed to return a state without the reaver in it when I tested it. My original code still seems to work.

I dont know why all the whitespace keeps changing. Maybe its the line endings or something. What settings are you using for that?