handle more complex case of numbers