C version almost done

clean up

fix .gitignore