Changed answer[o] in a foreach loop for printing all data that is in the answer object. MX records are now being checked and printed accordingly.