added custom environment functionality