minor fixes + difex the direction of gradient in ugb+fl