working version w.r.t. #11, but not there yet.