Restructured code, added reweighting tool.