works fine, maybe still too slow