Removed lots of unused code. Implemented Phases in Iterator