final update,note:flex version still has bugs