improved working example.

+create toJson method
+ example wueght cog has a pattern