reimplemented features from first assignment to new model's API