added a syncronized queue to the implementation for multiple readers and writers