fixed some errors on ctp problem. still not correct