next attempt at making a working deduper. man this is ugly.