Error fixed in creating factors and small stuff