All the functions have been written and tested