What are the entries made at the end of an accounting period to ensure that companies follow the revenue recognition and expense recognition principles?