adding x function