improve distribtion drawing function