implement Torch