Changed variable names to match those described in comments. `$num` -> `...

Changed variable names to match those described in comments. `$num` -> `$length`