figured out the problem, now running in js, but very slowly