Fixed race condition, added wait on empty/full queue, added comments, prepped for future additions