fixed voting bug + revised sorting method