the latest working version, with bug in sampling fixed