works but still slow