major overhaul, adding directory class