Merged new changes from katz for voting