cleaned up voting code a little bit