fixed bug in decide vote sp, and refacotred to make simpler