Initial write-up of functions