fix matthew calculation, clean plotting