Reworked rhcsh to be more efficient