start of conversion to managed pointers