main script that takes RM output