first ric function script