extended learn.m, added some infrastructure code which writes result files