added realtion code to models