use dictionary for attributes, and tested with output