Main code for RTS prototype.