some code for wang