Removed sample hooks
Adds a number generator; Refactors to use native functions in some cases