first code to solve normalize component relations
fixing some conceptual bugs