Added to_dict method
Upped version