PS: fix length computation