Modernized code and ported to ARC