found the bugs, the drop_max missed to negate (view correctly) the return value and sometimes when deciding where to put it it didn't matter but it the code it slipped buy and was catched by the power of defensive programming.