added a method to get the type of the tag
made the getData method public
added toString()