rewriting dir/play functions cont.