final code for Fei