implemented first version of render_dir