Completed the two functions and added two examples