working on making the RBM object a ref clas