CRMS Final!!!! added logging -- Manli