added procedures in run()