added zd function, fixing filename function