Cleaned up code and added another test for the hashCode