Fixed typos and added function headers

Fixed typos and added function headers