Added Producer consumer pattern, super optimized code now