fixed if-else if statement in quickest()