c++ code of anson's dep