works perfectly, still really slow