better integer generation and new buffer change