Rewriting noelkdf-ref.c... again...