modify to handle type environment which contains function derived information