Functions created and tested