clustering threaded. see glue.py too.