Some useful utility function for c by Qwr