Made some hanges to adapt to the framework