restructured some stuff; working on duplicates filter
minor fixes
worked quite a bit: working version I think.