refined ls function.