Added iterator for envioronments. TODO functions