updated weapon function