core script updated - first implementation of the length detection
included.