Fix learning (rewrite all)