fixed multiple votes bugs, refactored to cleaner code