Many fixes, still havent implemented correct nuisance variance