Added the implementation of the functions