rewrite env
cleanup eval
removed too complicated optimization