store intermediate vegetation layer; clean up some code