fixed hashCode, added constructors, testing