clean up code and trial on g++ with c11