Fixes compareTo method by exchanging -1/1 as return variable