factored 3 way rbm directory added, rbm base class added