implement the sharedpointer class