after struggling with typedefof, finally figured that part