major code rework