modified runprogram to receive argument for array and int