new code for relations