pointers for algorithmic solution