incorporated GA_JJ. added the flexibility to use any loss function.