Added the necessary code.

Implemented all of the functions.