Wrote function to compute cost given X,y and theta