Fixed btree if statement
Changed ration -> ratio