This is what I have in that line 166:
$x = round(($cube / ( $maxlength * $maxwidth)),2) ;

I have no idea if that's whats meant to be in there.