Added function to gen distributions