better but still some pointer issues