Environments mostly working

changed cdr and car to work with environments.