add sort with stack problem