first almost working version for book