fixed memory issues, now onto a "trying to pop an empty stack" issue