finally got double pointers to work