implementiran cba_rg algoritem