rm main method