clamp logitmueta function: addresses #138 (?)