Modified Env, added a map and paramCOunter. Might be off, but it's on the right track I think.