refactor pointer stuff, decide on threading methodology