switching to pure C99
fully merging origin