extracted "oscillateGently" function from loop()