rename new variables and get rid of unused ones