sword function