fixed bug with centers
added sampling of distributions