Trying to combine the pointer code with the old code. Some mistakes
A bit more of an update to the pointer code; still wrong