Use 'data' instead of 'f' to specify function to reduce weirdness