took care of warnings about unused variables and obsolete function