Added plotting function for factor shares and wrote some tests.