added implementation of flush
Merge pull request #65 from manne/flush

added implementation of flush