implemented relationships in models