simplify passlen calculation