Added a condition for multiple numbers and \n and tested