abstracted out environment, started modifying phase 1
beginning of phase 2