First attempt to replace Ptr with StackPtr at certain places. It's not running very far for now!