some adaptive learning hopefully
Various fixes