function ch {
	typeset pWt pWW
	set -A pWt "${pW[@]}"
	unset pW
	for pWW in "${pWt[@]}"; do
		[ "$pWW" ] && pW[${#pW[@]}]="$pWW"
	done
	unset pWt pWW
	[ $# -gt 0 -a -d "${1-}" ] && { cd "${1-}"; pW=""; } || {
		cd "${pW[${1:-1}]}"; unset pW[${1:-1}]; }
	set -A pW `pwd` "${pW[@]}"
	xtitle $hostname:${tty-}:$pW
	echo "${pW[@]}"
}