Written f function.