Removed some unnecessary logic from the work for ls