Documented the main file and implemented a buffer