Added function for f vector.