Was able to implement a successful removal of data from queue and writing it to another file