implemented neighbour weight as a callback

this has significantly slowed things down though