Added the Code

Added the code to the functions