Leader Election part 1

Half implementation of leader election