another update for By Factor

Reduced the line from 360.000 to 35 lines of code