some of TODOs have been done! hadis's codes have bugs, this is for merging