Added functions for finding left and right cosets.