better flash implementaion, more tests