implemented a solution to issue #2, but there may be a better one using
`bufname`