update schema
rewritten in python