fiddled with referencing counting