more work on environment switching
removed debug line