Add some code for g-code buffer