added zsh stat and upgrade functions