debug and clean up (learn,predict)