added the final keyword on method reduce