fixed voting, added comments and cleaned up some debug lines