Implement write queue

The actual write itself is not yet implemented