first section: build base environment