Use mop instead of buf[0] to make the code more readable (see issue #35)