Searching through the attributes of a class