Bug fix, and implemented ls function