An algorithm for a fairer and better voting system