thank you both very much. i like penagate's short function. could please explain the algorithm to me?