break out flush() for use in external programs
update to v0.0.5