Finished compareTo and equals method