completed work on variable tags removal

all tests are passing but this code isn't tested in practice