logsumexp works but breaks assignment of values to variables