working to fix RB code