run script is rewritten in python; several unused files deleted