Completely reloaded RTS code because someone's merge overwrote us.