new design using two goroutines and one channel