added sword function