Handles non-numeric and negative numbers