implented numerical inverse transform sampling