wq as a reference implementation