mainly fixed pointer issues