Added in validation and tests