remove weight length constraint old code