added buffering to the front end