modified getting maginal distributions, as sometimes it takes forever to do it
added kde split