completely rewritten

now does incremental sync