porting tinyZED to C