removed unused variables from functions according to compiler output