changed local variables to final