Solving relationship problem