Solution here: https://editor.p5js.org/omarwnema/sketches/QUsAHJcNX