unused procedure removed, 318 lines of C code