updated scope module; created new paint enviroment; added optimziation flags