working version with synthetic data