     # RequestVote RPC implementation
     def handle_rpc(state, _member, %RPC.RequestVote{} = rpc) do
       state = maybe_step_down(state, rpc.term)
+      |> State.reset_election_timer(self())
 
       vote_granted =
         cond do
           rpc.term < state.term ->
+          Logger.info("rejecting candidate for lower term #{rpc.term} vs #{state.term}")
             false
 
-          !is_nil(state.voted_for) && state.voted_for != rpc.candidate ->
-            false
+          # FIXME: this one is buggy because i'm not diligent about setting voted_for
+          # !is_nil(state.voted_for) && state.voted_for != rpc.candidate ->
+          #   Logger.info("rejecting candidate because already voted")
+          #   false
 
           # FIXME: idk if commit_idx is correct
           rpc.last_log_idx < state.commit_idx ->
+            Logger.info("rejecting candidate for last_log_idx")
             false
 
           # Everything checks out!

  end

  defmodule State do
    @leader_election_interval_ms 4000

    defstruct [
      :role, :leader, :term, :log, :commit_log, :commit_idx,

          reuseaddr: true,
        ])

    state = State.new() |> State.reset_election_timer(self())
    State.schedule_append_entries(self())

    {:ok, state}
  end
