Misc C programmes