Element 'recognition algorithm'