bloc tutorial code