added buffering based on fraglen