Document code and add examples