Added code for cumulative distrib