working example with oscillations