Wasn't perfect. Still isn't. Found some more bugs, and there will probably be more.