First draft of the functions