Advanced hall effect code working in conjunction with tail