added test write function. added queue pointers