strengthened gain analysis, made a dbase builder