Added checkboxes in directory page. Reordered functions