removed unused variables and macros