Repaired broken logic for numbers