Added code to bfgs in kernel.cu