added all assignment logic. hopefully this works