Using producer/consumer threading to speed things up.