changed local variables to be final, removed unused imports