some more removal of unused variables