leader election implementation (WIP)