code to select sword