C version complete without CWI or error testing

GIT WORKS AGAIN :D