still some path bugs, but more robust