a non tested but syntactically correct first try. possibly some labaled weighting errors