remove WriteSmat from main.c