works for all numbers of writers and readers