My version of ARF. Still not complete but closer. Check logic for bugs