Fixed bugs in accuracy()
further update accuracy() for d and D