Fixed some issues and finished equal_by_trans