Modified number processing function
Fix == bugs, add a test function