simplify sq_length functions