second version : still have some order problems need to be handled