Minor Changes to the code to expand features

Please have sample size less than 7000 else there could be a Memory
error.