Resolving timing problems and pointer issues