Added stat and statExists functions