did a lot of refactoring.  theres still a massive memory leak.. I have no idea how much of a leak I should concern myself with fixing.