added flash mode, as suggested in issue #62