rat is implemented, seems working.