added logic to switch between RHS functions with or without RTA