refactored voting codes, half implemented