adding proper typedefs s.t. all used types are known