updating Code book