passed pointer reference in two ways