handles negative numbers and spaces