Michael's c/c++ code