g and f out of simulateData