`firstbuf` and `lastbuf` are globals. You can delete these parameters.