finished liveness analysis, and did lots of refactoring