ChatGPT - p5.js Logic Buffer Function