Fixes some typo's and added comments to weighted_sample