Changed thread such that it gets arguments both from tuple and
dictionary