removed unnecessary local variables