adding pointer code