added other functions to the stdlib and refactored the examples code