adding voting_write function