Code reworked for maximum sample rate (6k), gui still crashing