Simplified dir()
Added tests