repaired gradient brackets, changed likelihood calculation