Phase 4 complete

included is the completed code for phase 4 as well as the phase 3 code
up to this point.