improved json example in python