made to work with version 0.6.0 of package ElementTree
update Pattern contract and adjusted patterns accordingly