function [fval model]=BlobMLE_Fast(X,data,sigma,xmatrix,ymatrix)
%Calculates the Log Likelihood (minus offset) of Gaussian Model    

x=X(1);
y=X(2);
Photons=X(3);
bg=X(4);

bg=abs(bg);

sz=size(data,1);

model=Photons*1/(2*pi*sigma^2)*exp(-1/(2*sigma^2)*...
    ( (x-xmatrix).^2+(y-ymatrix).^2  ) )+bg;

fval=sum(sum(model-data.*log(model)));

