Tried to make ARC compatible, pending due to slow performance.