modify py script as class implement