modification for calculating key words according to words length