sorted out problem in codebookfgbg, now working