Cleaned up extract_anir and extract_anil