Refactored code. Fixed bug where print statements would overlap due to threading. Changed threads to producer/consumer format.