fix bug in calcNegLL, cleanup