seems to work now, but probably very slow