relation function finished