Added run code for more types of programs