Added the get elements by tag name function
Added some error handling
merge resolved
output formatted