input: Write a function to debug the provided Python code so that it correctly implements the desired functionality. The function should ensure that f1 returns the correct value and that f2 correctly squares that value. Provide assert tests to verify the corrected code.
  assert f2(2) == 9
  assert f1(2) == 3
output: def f1(x):
      return x + 1
  
  def f2(x):
      return f1(x) ** 2