func: function finalizeLottery(uint _steps)
               afterInitialization {
          require(needsLotteryFinalization());
  
          if (lotteries[id].nearestKnownBlock != lotteries[id].decidingBlock) {
              walkTowardsBlock(_steps);
          } else {
              int winningTicket = lotteries[id].nearestKnownBlockHash %
                                  int(lotteries[id].numTickets);
              address winner = lotteries[id].tickets[uint(winningTicket)];
  
              lotteries[id].winningTicket = winningTicket;
              lotteries[id].winner = winner;
              lotteries[id].finalizationBlock = block.number;
              lotteries[id].finalizer = tx.origin;
  
              if (winner != 0) {
                  uint value = lotteries[id].jackpot;
                  bool successful =
                      winner.call.gas(GAS_LIMIT_DEPOSIT).value(value)();
                  if (!successful) {
                      Escrow(escrow).deposit.value(value)(winner);
                  }
              }
  
              var _ = admin.call.gas(GAS_LIMIT_DEPOSIT).value(this.balance)();
          }
      }