Adding acc function along with a couple minor adjustments.