Procedural c implementations added.