Update rt_functions.sh

Mostly done.