implement environment lookup