documenting and fixing pointer issues