corrected bug in advance weight calc