join and groupby implemented by self. but they have bugs. not working.