Removed the unecessary check of compare returning -1 and added a unversal check of <0