try to preserve other matrix variables

Two things I'm not sure about:

-Does it make sense to arbitrarily preserve the line number of other matrix variables? They might not make sense anymore.
-Can I actually do what I did in the map function?
I think there is a subtle bug here.  What happens if we're trying to go from 10 workers down to 5?  Should we be deleting the entries in env_matrix instead of breaking out of the loop and leaving them untouched?