adding c. wang's implementation of hdp